﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Torch.WL.Web.Admin.Frameset.Default" %>

<%@ Import Namespace="Torch.FrameWork.Langeuages" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>
        <%=ResourceManager.GetString("sitename") %></title>
    <link href="../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/css/indexFramework.css"
        rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div id="topdiv">
        <div class="header">
            <div class="sitename">
                <%=ResourceManager.GetString("sitename") %>-<%=ResourceManager.GetString("ver")%></div>
            <div class="mainbutton">
                <div class="ico">
                    <img alt="" src="../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/ico/home.gif" /></div>
                <div class="text">
                    <a href="Welcome.aspx" target="modulePanel" class="mainlink">
                        <%=ResourceManager.GetString("Default_Link_1") %></a></div>
                <div class="ico">
                    <img alt="" src="../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/ico/key.png" /></div>
                <div class="text">
                    <a href="ChangePassword.aspx" class="mainlink" target="modulePanel">
                        <%=ResourceManager.GetString("Default_Link_2") %></a></div>
                <div class="ico">
                    <img alt="" src="../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/ico/user.png" /></div>
                <div class="text">
                    <asp:LinkButton ID="lnkbtnLogout" CssClass="mainlink" runat="server" OnClick="lnkbtnLogout_Click"><%=ResourceManager.GetString("Default_Link_3") %></asp:LinkButton></div>
                <div class="toplist">
                    <asp:DropDownList ID="StyleList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="StyleList_SelectedIndexChanged">
                    </asp:DropDownList>
                </div>
            </div>
        </div>
        <div class="x-toolbar">
            <div class="welcome">
                <%=ResourceManager.GetString("Default_Lab_2") %><asp:Label ID="loginname" runat="server"
                    Text=""></asp:Label></div>
            <div style="float: left; display: none">
            </div>
        </div>
    </div>
    <div id="leftdiv" style="float: left;">
        <div class="Splitterheader">
            <%=ResourceManager.GetString("Default_Lab_1") %></div>
        <div class="SplitterPane">
            <asp:TreeView ID="MenuTreeView" runat="server" ImageSet="Msdn" NodeIndent="10" >
                <ParentNodeStyle Font-Bold="False" />
                <HoverNodeStyle BorderColor="#ff0000" />
                <SelectedNodeStyle BorderColor="#888888" BorderStyle="Solid" BorderWidth="1px" Font-Underline="False"
                    HorizontalPadding="3px" VerticalPadding="1px" />
                <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px"
                    NodeSpacing="1px" VerticalPadding="2px" />
            </asp:TreeView>
        </div>
    </div>
    <div id="splitdiv" style="float: left;" onclick="on_tool();">
        <p><img alt="显示或隐藏" id="frameshow" src="../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/ui/splitter_horCol.gif" /></p>
    </div>
    <div id="rightdiv" style="float: left;">
        <iframe id="modulePanel" name="modulePanel" style="width: 100%; height: 100%;" frameborder="0"
            scrolling="yes" src="Welcome.aspx?ui=<%=Request.Cookies["UIStyle"].Value%>" >
        </iframe>
    </div>
    </form>
</body>
</html>
<script type="text/javascript">
    function InitIframeHight() {
        document.getElementById("modulePanel").height = document.documentElement.clientHeight - 75;
        //document.getElementById("modulePanel").width = document.documentElement.clientWidth - 75;
    }
    //window.AddEvent('load', InitIframeHight);
    //window.AddEvent('resize', InitIframeHight);

</script>


<script type="text/javascript">

    var navigationHight = 60; //顶部导航条高度
    var menuWidth = 180; //菜单宽度

    var marginValue, m2;

    if (window.XMLHttpRequest) {
        if (!window.ActiveXObject) {
            marginValue = 11; // Mozilla, Safari,...
            m2 = 7;
        } else {
            marginValue = 10; //IE7
            m2 = 5;
        }
    } else {
        marginValue = 10; //IE6
        m2 = 8;
    }

    var leftdiv = document.getElementById("leftdiv");
    var splitdiv = document.getElementById("splitdiv");
    var rightdiv = document.getElementById("rightdiv");

    var frameshow = document.getElementById("frameshow");

    var FrameResize = function() {
        leftdiv.style.height = (document.body.clientHeight - navigationHight - marginValue)+ "px" ;
        rightdiv.style.height = (document.body.clientHeight - navigationHight - marginValue)+ "px" ;
        splitdiv.style.height = (document.body.clientHeight - navigationHight - marginValue)+ "px" ;
        rightdiv.style.width = (document.body.clientWidth - menuWidth - marginValue - m2) + "px" ;

        InitIframeHight();
        
    }

    function on_tool() {
        //判断菜单是否隐藏
        if (leftdiv.style.display == "none") {
            leftdiv.style.height = (document.body.clientHeight - navigationHight - marginValue)+ "px" ;
            rightdiv.style.height = (document.body.clientHeight - navigationHight - marginValue)+ "px" ;
            splitdiv.style.height = (document.body.clientHeight - navigationHight - marginValue)+ "px" ;
            rightdiv.style.width = (document.body.clientWidth - menuWidth - marginValue - m2)+ "px" ;
            leftdiv.style.display = "block";
            //splitdiv.style.marginLeft="0px";
            frameshow.src = "../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/ui/splitter_horCol.gif";
        }
        else {
            rightdiv.style.height = (document.body.clientHeight - navigationHight - marginValue)+ "px" ;
            splitdiv.style.height = (document.body.clientHeight - navigationHight - marginValue)+ "px" ;
            rightdiv.style.width = (document.body.clientWidth - marginValue)+ "px" ;
            leftdiv.style.display = "none";
            //splitdiv.style.marginLeft="0px";
            frameshow.src = "../Inc/Style/<%=Request.Cookies["UIStyle"].Value%>/ui/splitter_horExp.gif";
        }
    }

    //设定Cookie值
    function SetCookie(name, value) {
        var expdate = new Date();
        var argv = SetCookie.arguments;
        var argc = SetCookie.arguments.length;
        var expires = (argc > 2) ? argv[2] : null;
        var path = (argc > 3) ? argv[3] : null;
        var domain = (argc > 4) ? argv[4] : null;
        var secure = (argc > 5) ? argv[5] : false;
        if (expires != null) expdate.setTime(expdate.getTime() + (expires * 1000));
        document.cookie = name + "=" + escape(value) + ((expires == null) ? "" : ("; expires=" + expdate.toGMTString()))
    + ((path == null) ? "" : ("; path=" + path)) + ((domain == null) ? "" : ("; domain=" + domain))
    + ((secure == true) ? "; secure" : "");
    }

    //刷新页面     
    function settyle() {
        SetCookie("InterfaceStyle", document.getElementById("ddlInterfaceStyle").value)
        location.reload();
    }

    FrameResize();

    if (window.XMLHttpRequest) {
        if (!window.ActiveXObject) {
            window.onload = FrameResize; // Mozilla, Safari...          
        } else {
            window.onresize = FrameResize; //IE7
        }
    } else {
        window.onresize = FrameResize; //IE6
    }
</script>

